﻿using Microsoft.AspNetCore.Identity;
using System.ComponentModel.DataAnnotations.Schema;

namespace crip.Models
{
    public class CripUser : IdentityUser
    {
        private bool _isRealName = false;
        //地址
        public string? Address { get; set; }
        //头像     
        public string? HeadImageUrl { get; set; }
        //区域ID
        [ForeignKey("AreaId")]
        public Guid? AreaId { get; set; }
        public Area? Area { get; set; }
        //身份证真实姓名(加密储存)
        public string? RealName { get; set; }
        //身份证真实号码(加密储存)
        public string? RealID { get; set; }
        //身份证正面照片链接(加密储存)
        public string? frontIDCardUrl { get; set; }
        //身份证反面照片链接(加密储存)
        public string? backIDCardUrl { get; set; }
        
        //public ICollection<Picture> RealNamePictures = new List<Picture>();
        //收集内容
        public ICollection<DataCollection> DataCollects = new List<DataCollection>();
        //是否实名
        public bool IsRealName
        {
            get
            {
                if (RealName !=null&&RealID !=null)
                    return true;
                else
                    return false;
            }
            set { }
        }


        //角色
        public virtual ICollection<IdentityUserRole<string>> UserRoles { get; set; }
        public virtual ICollection<IdentityUserClaim<string>> Claims { get; set; }
        public virtual ICollection<IdentityUserLogin<string>> Logins { get; set; }
        public virtual ICollection<IdentityUserToken<string>> Tokens { get; set; }
    }
}
